
package it.jaco.aswiimotelib.events {

	import flash.events.*;

	public class WiimoteButtonsEvent extends Event {

		public static const NO_CHANGE_DOWN:uint = 0;
		public static const NO_CHANGE_UP:uint = 1;
		public static const CHANGE_DOWN:uint = 2;
		public static const CHANGE_UP:uint = 4;
		
		public static const BUTTON_B_DOWN:String = "buttonBDown";
		public static const BUTTON_LEFT_DOWN:String = "buttonLeftDown";
		public static const BUTTON_UP_DOWN:String = "buttonUpDown";
		public static const BUTTON_RIGHT_DOWN:String = "buttonRightDown";
		public static const BUTTON_DOWN_DOWN:String = "buttonDownDown";
		public static const BUTTON_MINUS_DOWN:String = "buttonMinusDown";
		public static const BUTTON_HOME_DOWN:String = "buttonHomeDown";
		public static const BUTTON_PLUS_DOWN:String = "buttonPlusDown";
		public static const BUTTON_A_DOWN:String = "buttonADown";
		public static const BUTTON_1_DOWN:String = "button1Down";
		public static const BUTTON_2_DOWN:String = "button2Down";
		
		public static const BUTTON_B_CLICK:String = "buttonBClick";
		public static const BUTTON_LEFT_CLICK:String = "buttonLeftClick";
		public static const BUTTON_UP_CLICK:String = "buttonUpClick";
		public static const BUTTON_RIGHT_CLICK:String = "buttonRightClick";
		public static const BUTTON_DOWN_CLICK:String = "buttonDownClick";
		public static const BUTTON_MINUS_CLICK:String = "buttonMinusClick";
		public static const BUTTON_HOME_CLICK:String = "buttonHomeClick";
		public static const BUTTON_PLUS_CLICK:String = "buttonPlusClick";
		public static const BUTTON_A_CLICK:String = "buttonAClick";
		public static const BUTTON_1_CLICK:String = "button1Click";
		public static const BUTTON_2_CLICK:String = "button2Click";
		public static const BUTTONS_UP:String = "wiimoteButtonsUp";

		function WiimoteButtonsEvent(evtName:String) {
			 super(evtName);
		}
		
		public static function get_buttonNameByIndex(index:uint):String {
			
			var btn:Array = ["Plus", "Up", "Down", "Right", "Left",
			                 "Home", "Minus", "A", "B", "1", "2"];
		
			return "button" +btn[index];
		}
	}
}